package main;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import dao.impl.SecurityDAOHibernateImpl;
import dao.impl.UserDAOHibernateImpl;
import entity.Passport;
import entity.User;

public class TestSecurity {
	public static void main(String[] args) throws ParseException{
		SecurityDAOHibernateImpl sd = new SecurityDAOHibernateImpl();
//		UserDAOHibernateImpl ud = new UserDAOHibernateImpl();
//		User user = ud.findUserByID("aebf24df-fa80-4788-b06d-9881e5db6136");
//		
//		Licence licence = new Licence();
//		SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH");
//		String deadLine = "2010/04/30 23";
//		System.out.println(sdf.parse(deadLine));
//		System.out.println(new Date());
//		licence.setDeadLine(sdf.parse(deadLine));
//		Licence licence = sd.getLicenceByLicenceID("2ca37472-616a-4652-8907-cfebe6456058");
//		sd.addLicence(licence);
//		sd.bindLicence(licence, user);
//		sd.addLicence(licence, user);
		
//		Service service = new Service("asdf", "asdf");
//		sd.addService(service, "username1","14d380ad-4d2a-4ec9-b457-33e9540dde08");
//		Licence licence = sd.findLicenceByUser("14d380ad-4d2a-4ec9-b457-33e9540dde08");
//		System.out.println(licence.getValidity());
		
//		System.out.println(sd.findService("14d380ad-4d2a-4ec9-b457-33e9540dde08", "username1").getServiceURI());
//		p(sd.findServiceByURI("asdf").getServiceName());
//		p(sd.findUserByLicence("62166206-379c-4cef-84d9-e345db9fb746").getUserId());
//		sd.removeLicence("cde7501b-0842-4e4b-8bb9-be8df3aa23db");
//		sd.removeService("asdf");
	}
	public static void p(Object o){
		System.out.println(o);
	}
}
